<link href="<?php echo URL::base() ?>media/vendor/css/ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet">
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-1.10.2.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery-ui-1.10.4.custom.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/js/jquery.ui.datepicker-zh-TW.js"></script>
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>
<link rel="stylesheet" href="<?php echo URL::base() ?>media/vendor/artdialog/skins/default.css" type="text/css" media="all" />
<script src="<?php echo URL::base() ?>media/vendor/artdialog/jquery.artDialog.js"></script>	
<style type="text/css">
.lab1{ text-align:right; display:inline-block; width:100px;margin-right:5px;}
.table thead tr th,.table tbody tr td{ text-align:center;}
</style>
<script type="text/javascript">
$(document).ready(function(){
	$('.table1 > tbody > tr:odd').css("background-color","#f5f5f5");
})
</script>
<div class="row">
  <div class="span11">   
  <form action="<?php echo URL::site() ?>receiptreport/select_receipt" method="GET">
                	<div style="margin-bottom:10px;"><span class="lab1">收货时间从:</span>
                	<input class="input-medium" type="text" value="<?php if(isset($date_from)) echo $date_from;?>" name='date_from'/ id="date_from"> 
                	到
                	<input class="input-medium" type="text" value="<?php if(isset($date_to)) echo $date_to;?>" name='date_to' id="date_to"/> 
								</div>		<div  style="margin-bottom:10px;"><?php if(isset($user)&&$user==2) {?>
                	<span class="lab1">收货员:</span><input class="input-medium" type="text" id="purchase_id" name='recieve_man' value="<?php if(isset($purchase_id)) echo $purchase_id;?>"/> 
									<?php }?></div><div  style="margin-bottom:10px;">
                	<span class="lab1">采购单号:</span><input style="margin-left:4px;" class="input-medium" type="text" value="<?php if(isset($purchaseorder_id)) echo $purchaseorder_id;?>" name='purchaseorder_id'/> 
                	</div><div style="margin-bottom:10px;">
                	<span class="lab1">供应商:</span><input style="margin-left:4px;" class="input-medium" type="text" value="<?php if(isset($supplier_id)) echo $supplier_id;?>" name='supplier'/> </div><div style="margin-bottom:10px;">
                	<span class="lab1">SKU:</span> <input class="input-medium" type="text" value="<?php if(isset($sku)) echo $sku;?>" name='sku'/> 
               	
             <button class="btn btn-info" type="submit" style="margin-left: 10px">查询</button>
              <button class="btn btn-inverse" type="reset" style="margin-left: 5px">重置</button></div>
					</form>
             
              </div>
</div>


<div class="row">
  <div class="span11" style=" width:auto;">
  
					<table class="table table1 table-hover " style="table-layout:fixed;">
						<thead>
							<tr style=" background-color:#2f96b4;color:#fff;">
								<th>
									收货明细单号
								</th>
								<th>
									收货单号
								</th>
								<th >
									采购单号
								</th>
								<th>
									收货时间
								</th>
								<th>
									供应商
								</th>
								<th>
									收货人员
								</th>
								<th>
									SKU
								</th>
								<th>
									中文名称
								</th>
								<th>
									储位
								</th>
								<th>
									采购数量
								</th>
								<th>
									到货数量
								</th>								
							</tr></thead><tbody>
						<?php if(isset($result)){
						foreach ($result as $v){
						?>
						<tr>
						<!-- 收货明细单号 -->
						<td><?php echo $v['id']?></td>
						<!-- 收货单号 -->
						<td><?php echo $v['recieve_invoice_id']?></td>
						<!-- 采购单号 -->
						<td><?php echo $v['purchaseorder_id']?></td>
						<!-- 收货时间 -->
						<td><?php echo $v['recieve_time']?></td>
						
						<!-- 供应商 -->
						<td><?php echo basic::getnameByid($v['supplier']);//echo $r->vProviderName;?></td>
						<!-- 收货人员 -->
						<td><?php echo  ORM::factory('user',$v['recieve_man'])->name;?></td>
						<!-- SKU -->
						<td><?php echo $v['sku']?></td>
						<!-- SKU名称 -->
						<td><?php echo $v['sku_name']?></td>
						<!-- 储位 -->
						<td><?php echo $v['storage_position']?></td>
						<!-- 采购数量 -->
						<td><?php echo $v['purchase_quantity']?></td>
							<!-- 到货数量 -->
						<td><?php echo $v['arrival_quantity']?></td>
						</tr>
						<?php
						 }
						}
						?>
						</tbody>
					</table>				
					<?php if(isset($pagination)) echo $pagination;?></div>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$.datepicker.setDefaults({ dateFormat: 'yy-mm-dd' });
							$("#date_from").datepicker({  
							    onSelect:function(dateText,inst){  
							       $("#date_to").datepicker("option","minDate",dateText);  
							    }  
							});  
							$("#date_to").datepicker({  
							    onSelect:function(dateText,inst){  
							        $("#date_from").datepicker("option","maxDate",dateText);  
							    }  
							});

})				
</script>

